package sealte.database.monitor.db;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import sealte.util.database.conn.DBINFOReader;

public class DBConnection {
	private final String configXMLPath = DBConnection.class.getResource("").getPath()+"../config/DBINFO.xml";
	private DBINFOReader info = null;
		
	public DBConnection(String connName) throws Exception {
		info = new DBINFOReader(this.configXMLPath,connName);
		info.doInitialize();
	}
	
	public Connection getConnection() throws Exception {
		return info.getConnection();
	}
	
	public static void close(ResultSet rs,PreparedStatement ps,Connection conn){
		DBINFOReader.close(rs, ps, conn);
	}
}
